package com.interview.domain;

import com.interview.strategy.PricingStrategy;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.math.BigDecimal;

@Data
@AllArgsConstructor
public class Fruit {
    private String name;
    private Double price;
    private PricingStrategy pricingStrategy;

    public OrderItem calculateCost(Integer quantity) {
        return pricingStrategy.costTotal(price.toString(),quantity.toString(),name);
    }
}
